<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>上海泛软科技有限公司-后台登陆</title>
<meta name="robots" content="nofollow" />
<meta name=”viewport” content=”width=device-width, initial-scale=1, maximum-scale=1″>
<link href="/Public/Css/admin-style.css" rel="stylesheet" type="text/css" />
<link href="/Public/Css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="/Public/Css/bootstrap.min.css" rel="stylesheet" type="text/css" />


<script language="javascript" type="text/javascript" src="/Public/Js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="/Public/Js/admin-common.js"></script>
<script language="javascript" type="text/javascript" src="/Public/Js/bootstrap.min.js"></script>
<!--<script language="javascript" type="text/javascript" src="/Public/Js/bootstrap.js"></script> -->
<script language="javascript" type="text/javascript" src="/Public/Js/rock_customer_list.js"></script>
<script language="javascript" type="text/javascript" src="/Public/Js/demo.js"></script>
<script language="javascript" type="text/javascript" src="/Public/Js/blob.js"></script>
<script language="javascript" type="text/javascript" src="/Public/Js/FileSaver.min.js"></script>
<script language="javascript" type="text/javascript" src="/Public/Js/jquery.base64.js"></script>
<script language="javascript" type="text/javascript" src="/Public/Js/jquery-1.10.2.min.js"></script>
<script language="javascript" type="text/javascript" src="/Public/Js/tableExport.js"></script>
<script language="javascript" type="text/javascript" src="/Public/Js/xlsx.core.min.js"></script>
</head>

<body>

<style>
  #hedaer{
     background:#B9D3EE;
	 padding-left:0px;
	 background-color:rgba(185,211,238,0.15);
	 width:100%;
	 height:110px;
	 border-bottom: 1px solid #ccc;
	 overflow:hidden ;
	 padding:5px;
  }
  .select_Sty{
     float:left;
  }
   .select_Sty select {
   width: 150px;
   padding: 1px;
   font-size: 14px;
   border: 1px solid #ccc;
   height: 20px;
   margin-right:20px;
   border-radius:5px
}
 #content #boder{
    padding-left:10px;
	padding-right:10px;
   
 }
 body{
   background-color:rgba(232,232,232,0.25);
 }
 h4{
    font-size: 14px;
	margin-bottom:0px;
 }
 h5{
   font-size: 10px;
 }
</style>
<!-- <form enctype="multipart/form-data" class="table-form" name="form1" method="post" action="<?php echo U('equipment_search_Management');?>">
 --><div id="background"> 
 
 <div id="hedaer">
   <h4 id="fileName">医院地图</h4>
   <div class="select_Sty">
   <h5>省份:</h5>
    <select name="sheng" id="sheng">
	<option selected="selected" value ="请选择">请选择</option>
	<?php if(is_array($province)): $i = 0; $__LIST__ = $province;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$province): $mod = ($i % 2 );++$i;?><option value ='<?php echo ($province["pro"]); ?>'><?php echo ($province["pro"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
    </select>
   </div>	

    <div class="select_Sty">
     <h5>区、县:</h5>
    <select name="qu" id="qu">
	<option selected="selected" value ="请选择">请选择</option>
	<?php if(is_array($city)): $i = 0; $__LIST__ = $city;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$city): $mod = ($i % 2 );++$i;?><option value ='<?php echo ($city["city"]); ?>'><?php echo ($city["city"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
    </select>
   </div>
   <div class="select_Sty">
     <h5>医院:</h5>
    <select name="yiyuan" id="yiyuan">
	 <option selected="selected" value ="请选择">请选择</option>
	<?php if(is_array($hos)): $i = 0; $__LIST__ = $hos;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$hos): $mod = ($i % 2 );++$i;?><option value ='<?php echo ($hos["name"]); ?>'><?php echo ($hos["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
    </select>
   </div>
  
   <div id="search" style="margin-left:60px;margin-top:30px">
    <button type="submit"  class="btn btn-primary btn-sm search">查询</button>
   </div>
 </div>   
<!--  </form> -->
 <div id="content">
   <div id="boder">
   <div style="100%;">
      <div id="items" style="width:80%;float:left;"> 
        <p><span id="count"></span></p> 
      </div>
	  <div style="width:20%;float:left;text-align:center">
		 <ul style="float:left;font-weight:bold">
		    <li style="float:left;margin:2px"><a href="#" id="modify" data-toggle="modal" data-target="#myModal">编辑</a></li> 
		   <li style="float:left;margin:2px"><a href="<?php echo U('hospital_image_add');?>"  >增加</a></li>

		 <!--   <li style="float:left;margin:2px"><a onclick="dev_del()">删除</a></li>
		    -->
		 </ul>
     </div>
   </div>
  
	<table class="table table-bordered deviceTblae" style="background:white">
	  <thead style="background-color:rgba(232,232,232,0.35);">
	 
		<tr>
		 <!--  <th style="text-align:center"><input type="checkbox"></input></th> -->
		  
		  <th style="text-align:left">省份</th>
		  <th style="text-align:left">区、县</th>
		  <th style="text-align:left">所属医院</th>
		  <th style="text-align:left">大楼名</th>
		  <th style="text-align:left">楼层</th>
		  <th style="text-align:center" width="10%">图片</th>
		  <th style="text-align:center">操作</th>
		 

		 
		 <!--  <td align="center" valign="middle">操作</td> -->
		</tr>
	  </thead>
	  <tbody class="data" id='maplist'>
	 <!-- <?php if(is_array($hospital)): $i = 0; $__LIST__ = $hospital;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$list): $mod = ($i % 2 );++$i;?><tr>
         
		  <td style="text-align:left"><?php echo ($list['h_province']); ?></td>
		  <td style="text-align:left"><?php echo ($list['h_city']); ?></td>
		  <td style="text-align:left"><?php echo ($list['h_name']); ?></td>
		  <td style="text-align:left"><?php echo ($list['f_name']); ?></td>
		  <td style="text-align:left"><?php echo ($list['i_name']); ?></td>
		  <td style="text-align:right"><img title="" width="100%" src="<?php echo ($list['img_src']); ?>"></td>
		   <td style="text-align:center">
		  <a class="foundEdit" href="<?php echo U('hospital_image_edi','id='.$list['i_id']);?>">修改</a> 
<a class="del" href="<?php echo U('hospital_image_del','id='.$list['i_id']);?>" onClick="return confirm('确定要删除吗？')">删除
</a></td>
		  

 		</tr><?php endforeach; endif; else: echo "" ;endif; ?>-->
	  </tbody>
	</table>
<ul class="pagination" id="pagelist" style="float:right;margin:0px">
</ul>
   </div>
 </div>
</div>

 <script>
  $.ajax({
  	    url: '/javajy/index.php/Admin/Wenlian/hospital_Map2',
  	    type: 'POST',
 	    dataType: 'JSON',//here
		data:{
		 },
 	      success: function(data){
       var html='';
       $("#maplist").empty(); 
		  var pagesize=10; 
	      var len;
	      var _len=data.length;
	      if(data.length<pagesize){
	            len=data.length;
	         }else{
	           len=pagesize;

	         }
	      
       for(var i=0;i<len;i++){
       	 html='';
         html += '<tr>'
		  +'<td style="text-align:left">'+data[i].h_province+'</td>'
		  +'<td style="text-align:left">'+data[i].h_city+'</td>'
		  +'<td style="text-align:left">'+data[i].h_name+'</td>'
		  +'<td style="text-align:left">'+data[i].f_name+'</td>'
		  +'<td style="text-align:left">'+data[i].i_name+'</td>'
		  +'<td style="text-align:right"><img title="" width="100%" src="'+data[i].img_src+'"></td>'
		  +' <td style="text-align:center">'
		  +' '		   	
          +' <a class="del" id="'+data[i].i_id+'">删除'
          +'</a></td>'
          $("#maplist").append(html);
             }
  var  count=Math.ceil(_len/pagesize);
      var pagehtml='';
      if(_len>pagesize){
        $('#pagelist').empty();
         for(var i=1;i <= count;i++){

          pagehtml='';
          pagehtml +=
              '<li id='+i+'><a href="#">'+i+'</a></li>'
 
            $('#pagelist').append(pagehtml);

        }

    }
   $('#pagelist li').each(function(){

      $(this).click(function(){

               var id=$(this).attr('id');
               var startid=(id-1)*pagesize;
               var endid=id*pagesize;
               if(endid<_len){
                  endid=endid;

               }else{
                endid=_len;
               }
               $('#maplist').empty();
          var _html='';

        for(var i = startid; i <endid;i++){
        	_html='';
            _html +='<tr>'
			  +'<td style="text-align:left">'+data[i].h_province+'</td>'
			  +'<td style="text-align:left">'+data[i].h_city+'</td>'
			  +'<td style="text-align:left">'+data[i].h_name+'</td>'
			  +'<td style="text-align:left">'+data[i].f_name+'</td>'
			  +'<td style="text-align:left">'+data[i].i_name+'</td>'
			  +'<td style="text-align:right"><img title="" width="100%" src="'+data[i].img_src+'"></td>'
			  +' <td style="text-align:center">'
			  +' '		   	
	          +' <a class="del" id="'+data[i].i_id+'">删除'
	          +'</a></td>'

	          $("#maplist").append(_html);		 	 
			  }
			 

           })

        })
         
   //修改医院地图
  //      $('.foundEdit').each(function(){

  //      $(this).click(function(){
  //      var id=$(this).attr('id');
  //      alert(id);
  //      $.ajax({
  // 	    url: '/javajy/index.php/Admin/Wenlian/hospital_image_edi',
  // 	    type: 'POST',
 	//     dataType: 'JSON',//here
		// data:{
		// 	id:id
		//  },
 	//       success: function(){}
 	//     })



  //      	  })
  //      })
   //删除医院地图
       $('.del').each(function(){

       	  $(this).click(function(){
       	  	var id=$(this).attr('id');
          alert(id);
        $.ajax({
	    url: '/javajy/index.php/Admin/Wenlian/hospital_image_del',
	    type: 'POST',
	    dataType: 'JSON',//here
		data:{
			id:id
		 },
	      success: function(data){
          if(data="删除成功"){
            alert("删除成功");
          	location.reload(true); 
          }else{

           alert("失败");

          }
	      }
	    })
       	  })
       })


 	      }


 	 })
		 


 </script> 

</body>
</html>